Ive looked over my program 100 times and i can not find way i have this error.
Please HELP
Code:
#include
"stdafx.h"
#include
<windows.h>
#include
<stddef.h>
#include
<stdlib.h>
#include
<conio.h>
#include
<stdio.h>
int
stack[5],top=-1,value,i,stop=0;
void
push(int value)
{
if(top=4)
{
printf(
"Stack is full or overflow had happend\n Please understand you may only fill the stack up to a certain limit");
}
else {
top=top+1;
stack[top]=value;
}
}
void
pop()
{
if(top==-1)
{
printf(
"Stack is empty and you need to Push a number into it");
}
else {
top=top-1;
stack[top]=value;
}
}
void
show()
{
for(i=0;1<=top;i++)
{
printf(
"\nThe numbers you have entered within the stack\n,%a[i]");
}
}
int
main()
{
int pick,value;
while(stop==1){
printf(
"\n1.Push:");
printf(
"\n2.POP:");
printf(
"\n0.Exit:");
printf(
"\n3.Results:");
printf(
"\nEnter your choice:");
if(pick==1)
{
printf(
"\nEnter value to be incerted:");
scanf_s(
"%d",value);
push(value);
}
if(pick==2)
{
pop();
}
if(pick==3)
{
show();
}
if(pick==0)
{
printf(
"\nThank you for using Dan's Push and Pop programing\n GOOD BYE ");
exit(0);
}
return 0;
}